Skip to content

[FEAT] Soroban: Implement withdraw logic (#198)#216

Merged
ogazboiz merged 4 commits intoLabsCrypt:mainfrom
JamesVictor-O:feat/198-soroban-withdraw-logic
Feb 27, 2026
Merged

[FEAT] Soroban: Implement withdraw logic (#198)#216
ogazboiz merged 4 commits intoLabsCrypt:mainfrom
JamesVictor-O:feat/198-soroban-withdraw-logic

Conversation

@JamesVictor-O
Copy link
Copy Markdown
Contributor

@JamesVictor-O JamesVictor-O commented Feb 26, 2026

Summary

  • Implement and verify the Soroban stream withdraw logic so recipients can claim time-accrued funds.
  • Fix and extend tests around initialization, top-ups, withdraw behavior, and cancellation to match the intended streaming semantics.

Implementation details

  • withdraw now relies on calculate_claimable to compute (now - last_update_time) * rate_per_second and caps at remaining deposited balance, marking the stream inactive when fully drained.
  • Tests cover recipient-only access, inactive streams, time-based accrual over multiple withdrawals, and caps at remaining balance, plus cancelation flows that settle the recipient and refund the sender.

Issue

Closes #198.

JamesVictor-O and others added 4 commits February 26, 2026 13:49
Align Soroban stream withdraw and cancellation behavior with time-based accrual semantics, fixing test helpers around initialization, top-ups, and withdraw events.

Made-with: Cursor
@ogazboiz ogazboiz merged commit 408095e into LabsCrypt:main Feb 27, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Soroban: Implement withdraw Logic

2 participants